home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c
- Path: durham.org!cschmidt
- From: cschmidt@freenet.durham.org (Chris Schmidt)
- Subject: Re: What should be returned?
- X-Newsreader: TIN [version 1.2 PL2]
- Sender: news@freenet.durham.org (news)
- Nntp-Posting-Host: freenet.durham.org
- Organization: Durham Free-Net
- Message-ID: <DLEvrv.K85@freenet.durham.org>
- References: <4dj8pv$cjd@eng_ser1.erg.cuhk.hk>
- Date: Fri, 19 Jan 1996 04:43:07 GMT
-
- the CAReLess boy (phsung@cs.cuhk.hk) wrote:
- : Hi, all,
-
- : It's said that the function main must return an integer value
- : but I just don't know what value should be returned. Also, if I quit
- : main by exit(), what's the use of the return value?
-
- : Any help?
-
- I myself am just starting to learn this stuff too, but from what I have
- read so far.. if you do not require an exit value from the program use:
-
- void main(void)
-
- Otherwise you might want your program to return a status code that might
- be used to determined if it has executed properly without errors. Then
- you would use:
-
- int main()
- {
- stuf.....
-
- return (stat_code);
- }
-
- or something similar.
-
- You C gurus out there can correct me if I am wrong on this..I AM just a
- rookie and don't want to get into the bad habits this soon ;-)
-
-
- --
- -------------------------------------------
- Chris Schmidt
- cschmidt@freenet.durham.org
- -------------------------------------------
-